#include <stdio.h>
#include <stdlib.h>
#include <unistd.h>
int main()
{
    pid_t id = fork();
    if(id < 0)
    {
        perror("fork");
        return 1;
    }
    else if(id == 0)
    {
       //child
       while(1)
       {
            printf("I am child : %d ,ret : %d\n",getpid(),id);
            sleep(1);
            exit(0);
        }
    }
    else
    {
    //father
        while(1)
        {
            printf("I am father : %d,ret: %d\n", getpid(),id);
            sleep(1);
        }
    }
 return 0;
}
